let paginationBev = Behavior({
  data: {
    dataArray: [],
    total: null,
    noneResult:false
  },
  methods: {
    setMoreData(dataArray) {
      const tempArr = this.data.dataArray.concat(dataArray)
      this.setData({
        dataArray: tempArr
      })
    },

    getCurrentStart() {
      return this.data.dataArray.length
    },

    setTotal(total) {
      this.data.total = total
      if(!total){
        this.setData({
          noneResult:true
        })
      }
    },

    hasMore() {
      if (this.data.dataArray.length >= this.data.total) {
        return false
      } else {
        return true
      }
    },
    init(){
      this.setData({
        dataArray:[],
        noneResult:false
      })
      this.data.total = null
    }
  }
})

export {
  paginationBev
}